package huriezy.quickcontacts.models;

import android.content.Context;
import android.util.Log;
import android.widget.Toast;

public class LogDebug {

	public enum LogMode{
		NO_LOG, DEBUG_LOG, TOAST_lOG
	}
	
	public static LogMode localeLogMode = LogMode.DEBUG_LOG;
	
	public static void error(String message, Context context, Throwable throwable) {
		if(localeLogMode == LogMode.DEBUG_LOG){
			Log.e(context.getClass().getSimpleName(), message, throwable);
		}
		else if(localeLogMode == LogMode.TOAST_lOG){
			Toast.makeText(context, message, Toast.LENGTH_SHORT).show();;
		}			
	}
	

	public static void error(String message, Class<?> classObject, Throwable e) {
		if(localeLogMode == LogMode.DEBUG_LOG){
			Log.e(classObject.getSimpleName(), message, e);
		}
	}
	

	public static void error(String message, Class<?> classObject) {
		if(localeLogMode == LogMode.DEBUG_LOG){
			Log.e(classObject.getSimpleName(), message);
		}
	}
	
	public static void error(String message, Context context) {
		if(localeLogMode == LogMode.DEBUG_LOG){
			Log.e(context.getClass().getSimpleName(), message);
		}
		else if(localeLogMode == LogMode.TOAST_lOG){
			Toast.makeText(context, message, Toast.LENGTH_SHORT).show();;
		}			
	}
	
	public static void warn(String message, Context context) {
		if(localeLogMode == LogMode.DEBUG_LOG){
			Log.w(context.getClass().getSimpleName(), message);
		}
		else if(localeLogMode == LogMode.TOAST_lOG){
			Toast.makeText(context, message, Toast.LENGTH_SHORT).show();;
		}			
	}
	
	public static void warn(String message, Class<?> classObject) {
		if(localeLogMode == LogMode.DEBUG_LOG){
			Log.w(classObject.getSimpleName(), message);
		}
	}

	public static void info(String message, Class<?> classObject) {
		if(localeLogMode == LogMode.DEBUG_LOG){
			Log.i(classObject.getSimpleName(), message);
		}
	}	
	
	public static void debug(String message, Class<?> classObject) {
		if(localeLogMode == LogMode.DEBUG_LOG){
			Log.d(classObject.getSimpleName(), message);
		}
	}
	
	public static void verbose(String message, Class<?> classObject) {
		if(localeLogMode == LogMode.DEBUG_LOG){
			Log.v(classObject.getSimpleName(), message);
		}
	}
}
